package com.cloud.lan.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cloud.lan.entity.model.dataobject.LanMpCouponDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 用户信息表 Mapper 接口
 * </p>
 *
 * @author xyqierkang@163.com
 * @since 2021-12-06
 */
@Mapper
public interface LanMpCouponMapper extends BaseMapper<LanMpCouponDO> {

    @Select("SELECT * FROM lan_mp_coupon WHERE use_open_id= #{openId} AND is_deleted=0")
    LanMpCouponDO getMpCouponByOpenId(@Param("openId") String openId);
    @Select("SELECT * FROM lan_mp_coupon WHERE status= #{status} AND is_deleted=0 limit 1")
    LanMpCouponDO getMpCouponByStatus(@Param("status") int status);
}
